home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / bbs / fax_it_cnet.lzh / FAX-IT / fax-stat < prev    next >
Text File  |  1994-09-10  |  1KB  |  49 lines

  1. /*
  2. ** This program displays any FAX STATUS messages that are in the
  3. ** user's mail directory. The STATUS messages will delete any FAX messages
  4. ** that failed and are not wanted, or place them back in the stack to
  5. ** be retried. 
  6. */
  7.  
  8. Options Results
  9.  
  10. ChangeWhere 'FAX-IT!'
  11. ChangeWhat  'Checking Status'
  12.  
  13. GetUser 1307954 ; UserDir = Result
  14. OutDir    = 'Doors:Fax-IT/Text/'
  15. GetUser 40 ;  UserNum = Result
  16.  
  17. TextFile = UserDir'FaxStatus'
  18. DoFile     = UserDir'FaxClean'
  19.  
  20. if Exists(TextFile) then do
  21.     file1=open(infile,TextFile,read)
  22.     if file1=1 then do
  23.         file2=open(outfile,DoFile,write)
  24.         if file2=1 then do
  25.             do while ~eof(infile)
  26.                 text=readln(infile)
  27.                 if text='--FAILED--' then call FailedFAX
  28.                 else Print text
  29.             end
  30.             WriteLN(outfile,'delete 'TextFile)
  31.             WriteLN(outfile,'delete 'DoFile)
  32.             close(outfile)
  33.         end
  34.         close(infile)
  35.     end
  36.     Print 'c7FAX Status information deleted.....n2'
  37.     more
  38.     address Command 'c:Execute "'DoFile'"'
  39. end
  40. Exit
  41.  
  42.  
  43. FailedFAX:
  44.     FileName=ReadLN(infile)
  45.     Query 'q1Would you like to try this FAX again? (y/c1Nq1) '
  46.     if Result='y' then WriteLN(outfile,'Move 'FileName' From 'UserDir' to 'OutDir)
  47.     else WriteLN(outfile,'Delete 'UserDir||FileName)
  48.     return
  49.